package cn.rulian.car.car.bo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import cn.rulian.base.common.bo.BaseSetBo;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 车辆信息
 */
@Entity
@Table(name = "car_car_car")
public class Car extends BaseSetBo {

	@Column(length = 20)
	private String code; //编号
	
	@Column(length = 50)
	private String name; //名称

	@Column(length = 20)
	private String carNumber; //车牌号

	@Column(length = 50)
	private String driver; //默认司机
	
	@Column(length = 100)
	private String carStatus; //车辆状况（每次填单时自动更新）
	
	private Integer endNum; //行驶里程（每次填单时自动更新）
	
	@ManyToOne
	@JoinColumn(name = "carType_id")
	private CarSort carType; //车辆类型

	@Column(length = 50)
	private String engineNumber; //发动机编号

	@Column(length = 50)
	private String chassisNumber; //底盘编号

	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") //json格式化输出，列表显示时用
	@DateTimeFormat(pattern="yyyy-MM-dd") //Spring MVC格式转换：增加、修改时，向后台传送数据时用
	private Date insuranceDate; //保险到期日期

	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") //json格式化输出，列表显示时用
	@DateTimeFormat(pattern="yyyy-MM-dd") //Spring MVC格式转换：增加、修改时，向后台传送数据时用
	private Date upkeepDate; //保养日期
	
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") //json格式化输出，列表显示时用
	@DateTimeFormat(pattern="yyyy-MM-dd") //Spring MVC格式转换：增加、修改时，向后台传送数据时用
	private Date nextUpkeepDate; //下次保养日期
	
	private Integer upkeepNum; //上次保养里程
	
	private Integer nextUpkeepNum; //本次保养里程
	
	@Column(length = 200)
	private String remark; //备注

	public String getCode()
	{
		return code;
	}

	public void setCode(String code)
	{
		this.code = code;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getCarNumber()
	{
		return carNumber;
	}

	public void setCarNumber(String carNumber)
	{
		this.carNumber = carNumber;
	}

	public String getDriver()
	{
		return driver;
	}

	public void setDriver(String driver)
	{
		this.driver = driver;
	}

	public String getCarStatus()
	{
		return carStatus;
	}

	public void setCarStatus(String carStatus)
	{
		this.carStatus = carStatus;
	}

	public Integer getEndNum()
	{
		return endNum;
	}

	public void setEndNum(Integer endNum)
	{
		this.endNum = endNum;
	}

	public String getEngineNumber()
	{
		return engineNumber;
	}

	public void setEngineNumber(String engineNumber)
	{
		this.engineNumber = engineNumber;
	}

	public String getChassisNumber()
	{
		return chassisNumber;
	}

	public void setChassisNumber(String chassisNumber)
	{
		this.chassisNumber = chassisNumber;
	}

	public Date getInsuranceDate()
	{
		return insuranceDate;
	}

	public void setInsuranceDate(Date insuranceDate)
	{
		this.insuranceDate = insuranceDate;
	}

	public Date getUpkeepDate()
	{
		return upkeepDate;
	}

	public void setUpkeepDate(Date upkeepDate)
	{
		this.upkeepDate = upkeepDate;
	}

	public Date getNextUpkeepDate()
	{
		return nextUpkeepDate;
	}

	public void setNextUpkeepDate(Date nextUpkeepDate)
	{
		this.nextUpkeepDate = nextUpkeepDate;
	}

	public Integer getNextUpkeepNum()
	{
		return nextUpkeepNum;
	}

	public void setNextUpkeepNum(Integer nextUpkeepNum)
	{
		this.nextUpkeepNum = nextUpkeepNum;
	}

	public String getRemark()
	{
		return remark;
	}

	public void setRemark(String remark)
	{
		this.remark = remark;
	}

	public Integer getUpkeepNum()
	{
		return upkeepNum;
	}

	public void setUpkeepNum(Integer upkeepNum)
	{
		this.upkeepNum = upkeepNum;
	}

	public CarSort getCarType()
	{
		return carType;
	}

	public void setCarType(CarSort carType)
	{
		this.carType = carType;
	}
	
}
